package  {
	import flash.display.MovieClip;
	import flash.events.Event;
	
	public class CanvasInner extends MovieClip {
		
		
		
		
		//buttons
		private var innerButtons:Array=new Array();
		
		//display
		private var innerUp:InnerDisplay;
		private var innerDown:InnerDisplay;
		private var innerClose:InnerDisplay;
		private var innerOpen:InnerDisplay;
		
		//offset
		private   var offset:int=400;
	
		// Initialization:
		public function CanvasInner(elevator:Elevator,pContainer:MovieClip,x:int,y:int) {
			
			
			//for test
			//this.addEventListener("task",eventTask);
			
			//init buttons
			
			for(var i:int=0;i<20;++i)
			{
				innerButtons[i]=new InnerButton(elevator,pContainer,x,y-20*i,i+1);
				innerButtons[i].buttonMode=true;
				
			}
			
			//x+=10;
			//init display
			innerUp=new InnerDisplay(elevator,pContainer,x+80,y-offset,"up");
			innerDown=new InnerDisplay(elevator,pContainer,x+100,y-offset,"down");
			//innerClose=new InnerDisplay(elevator,pContainer,x+60,y-offset,"close");
			//innerOpen=new InnerDisplay(elevator,pContainer,x+40,y-offset,"open");
			
		}
		
		public function getInnerButtons():Array
		{
			return innerButtons;
		}
		
		public function displayState(direction:String,state:String):void
		{//state???
			if(direction=="up")
			{
				innerUp.setTrue();
				innerDown.setFalse();
			}
			else if(direction=="down")
			{
				innerDown.setTrue();
				innerUp.setFalse();
			}
			else
			{
				innerUp.setFalse();
				innerDown.setFalse();
			}
		}
	
		
		
	}
	
}